package api_day08;

import java.util.Objects;

public class TestDemo {
    public static void main(String[] args) {
    }
}
class Person {
    private String name,comment;
    private int age;

    public Person(String name, String comment, int age) {
        this.name = name;
        this.comment = comment;
        this.age = age;
    }

    public boolean equals(Object o){
        if (!(o instanceof Person)) return false;
        Person p = (Person) o;
        return age == p.age && name.equals(p.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, comment, age);
    }
}